bool Push(Stack S, ElementType X){  
    if(S->Top-1==S->MaxSize-1){  
        printf("Stack Full\n");  
        return false;  
    } 
    S->Data[S->Top]=X;  
    S->Top++;  
    return true;  
}  
  
ElementType Pop(Stack S){  
    ElementType X;
    if(S->Top==0){  
        printf("Stack Empty\n");  
        return ERROR;  
    }  
    S->Top--;  
    X = S->Data[S->Top];  
  
    return X;  
} 
